﻿using DevExpress.XtraEditors;
using Lamex.Library.CommonClass;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Lamex.mIE.UI
{
    public partial class Frm_IE_PartInterFace : Form
    {
        public Frm_IE_PartInterFace()
        {
            InitializeComponent();
            txt1DWG_NO.Text = "I3FA337A";
            txt1Part_No.Text = "3033256353";
            txt1Logic.Text = "?(W+H)*2/1000";

            txt2DWG_NO.Text = "TBD";
            txt2Part_No.Text = "3033283795";
            txt2Logic.Text = "?1/ROUNDDOWN(3200/L)";

            txt3DWG_NO.Text = "I3FA337A";
            txt3Part_No.Text = "3033298206";
            txt3Logic.Text = "?H:800,(W:800,8|,10)|,10)";

            txt4DWG_NO.Text = "TBD";
            txt4Part_No.Text = "3033255056";
            txt4Logic.Text = "4";

            txt5DWG_NO.Text = "I3FA337A";
            txt5Part_No.Text = "3033256353";
            txt5Logic.Text = "?W:1300,2|,42";

            txt6DWG_NO.Text = "";
            txt6Part_No.Text = "";
            txt6Logic.Text = "";

            //txt1DWG_NO.Text = "";
            //txt1Part_No.Text = "";
            //txt1Logic.Text = "";

        }

        private void btnTest_Click(object sender, EventArgs e)
        {
            //string str1, str2, str3, str4, str5, str6;

            try
            {
                txt1ReValue.Text = IELogicHelper.GetLogicValue(txt1DWG_NO.Text, txt1Part_No.Text, txt1Logic.Text);
                txt2ReValue.Text = IELogicHelper.GetLogicValue(txt2DWG_NO.Text, txt2Part_No.Text, txt2Logic.Text);
                txt3ReValue.Text = IELogicHelper.GetLogicValue(txt3DWG_NO.Text, txt3Part_No.Text, txt3Logic.Text);
                txt4ReValue.Text = IELogicHelper.GetLogicValue(txt4DWG_NO.Text, txt4Part_No.Text, txt4Logic.Text);
                txt5ReValue.Text = IELogicHelper.GetLogicValue(txt5DWG_NO.Text, txt5Part_No.Text, txt5Logic.Text);
                txt6ReValue.Text = IELogicHelper.GetLogicValue(txt6DWG_NO.Text, txt6Part_No.Text, txt6Logic.Text);
            }
            catch(Exception ex)
            {
                XtraMessageBox.Show(ex.Message);
            }       
        }

        //public static string GetValue(string LogicValue)
        //{
        //    string str
        //}
    }
}
